# -*- coding: utf-8 -*-
"""
Created on Thu Nov 18 17:32:18 2021

@author: Administrator
"""

import pandas as pd
import numpy as np
import os
import itertools


path = r'C:\Users\Administrator\Desktop\新建文件夹'
os.chdir(path)

string='''
582656-582911
585216-585471
588288-588415
591104-591359
600384-600447
600448-600511
'''

cis = string.strip().split('\n')

ci = [list(range(int(x.split('-')[0]),int(x.split('-')[1])+1)) for x in cis]
ci = [list(map(lambda x:str(x),y)) for y in ci]

allci = list(itertools.chain(*ci))

df = pd.read_excel('4G全量工参 -20211116.xlsx')
df.columns
df['eNodeB_ID'] = df.INDEX.map(lambda x:x.split('_')[0])

eNodeB = list(set(df['eNodeB_ID']))


notused = [x for x in allci if x not in eNodeB ]

'582659' in eNodeB

df1 = pd.DataFrame({'eNodeB':notused})
with pd.ExcelWriter('中兴未使用eNodeB.xlsx') as f:
    df1.to_excel(f ,index = False)